<template>
    <div>
        <div class="info-wrap">
            <div class="info-title ellipsis">{{ fileName }}</div>
            <div class="fs-12 fc-999 mb5" v-if="editionType === '2' && type == 3">来源：{{ fileInfo.siteName }}</div>
            <div class="fs-12 fc-999">
                <span>{{ fileInfo.readCount || 0 }} 次查看</span><span> | {{ fileInfo.collectCount }} 次收藏</span><span v-if="fileInfo.downloadCount"> | {{ fileInfo.downloadCount }} 次下载</span><span v-if="fileInfo.praiseCount"> | {{ fileInfo.praiseCount }} 赞</span>
            </div>
        </div>
        <div class="diss-wrap">
            <div class="diss-title">
                <i class="title-tip"></i>讨论
            </div>
            <!-- 讨论列表 -->
            <Discuss-List ref="discussList" :docId="id" isDoc :showBtmBar="false"></Discuss-List>
        </div>
    </div>
</template>

<script>
import { mapGetters } from "vuex"
import DiscussList from '@/components/course/Discuss'
export default {
    components: {
        DiscussList,
    },
    props: {
        fileName: {
            type: String,
            default: ''
        },
        fileInfo: {
            type: Object,
            default: () => {}
        },
        id: {
            type: String,
            default: ''
        },
        type: {
            type: String,
            default: ''
        },
    },
    computed: {
        ...mapGetters({
            editionType: 'license/editionType'
        })
    },
    methods: {
        showDisConfirm() {
            this.$refs['discussList'].showDisConfirm()
        }
    }
}
</script>

<style lang="scss" scoped>
    .info-wrap {
        padding: 15px;
        .info-title {
            font-size: 18px;
            font-weight: 600;
            line-height: 25px;
            margin-bottom: 6px;
        }
        border-bottom: 6px solid #F6F6F6;
    }
    .diss-wrap {
        padding: 15px;
        .diss-title {
            font-size: 14px;
            font-weight: 600;
            .title-tip {
                width: 6px;
                height: 6px;
                background: #1EA69D;
                display: inline-block;
                margin-right: 7px;
                vertical-align: middle;
            }
        }
    }
</style>